package com.ideal.controller;

import com.ideal.dto.Page;
import com.ideal.dto.ResultDto;
import com.ideal.model.ConfigVersion;
import com.ideal.service.IConfigVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 配置版本 Controller
 *
 * @author songfz
 * @date 2022-07-13
 */
@Controller
@RequestMapping("/ideal/config/version")
public class ConfigVersionController
{
    @Autowired
    private IConfigVersionService configVersionService;

    /**
     * 查询配置版本 列表
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    public Page list(ConfigVersion configVersion)
    {
        List<ConfigVersion> list = configVersionService.selectConfigVersionList(configVersion);
        return new Page();
    }

    /**
     * 导出配置版本 列表
     */
    @RequestMapping(value = "/export",method = RequestMethod.POST)
    public void export(HttpServletResponse response, String version)
    {

    }

    /**
     * 获取配置版本 详细信息
     */
    @RequestMapping(value = "/detail",method = RequestMethod.GET)
    public ResultDto getInfo(Long versionId)
    {
        return ResultDto.success(configVersionService.selectConfigVersionById(versionId));
    }


}
